package com.ysd.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.ysd.entity.Team;
import com.ysd.util.DBManager;

public class TeamDaoImpl {

	public List<Team> getYingShiLeiXing(){
		List<Team> list=new ArrayList<Team>();
		Connection conn = DBManager.getConnection();
		Statement st=null;
		ResultSet rs=null;
		Team team=null;
		
		try {
			st =conn.createStatement();
			rs=st.executeQuery("select *from team");
			while(rs.next()){
				int teamId=rs.getInt("teamId");
				String teamName=rs.getString("teamName");
				String zhiCehng=rs.getString("zhiCehng");
				String img=rs.getString("img");
				 team =new Team(teamId, teamName, zhiCehng, img);
						
				list.add(team);
			}
			
			return list;
		} catch (SQLException e) {
			e.printStackTrace();
			return null;
		}finally {
			DBManager.closeAll(conn, st, rs);
		
	}
}
	
}
